<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
	<base href="<{$B_Url}>" />
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>在线客服系统</title>  
	<load href="__PUBLIC__/bootstrap/css/bootstrap.min.css" />
	<load href="__PUBLIC__/bootstrap/css/bootstrap-theme.min.css" /> 
	<load href="__PUBLIC__/bootstrap/js/jquery.min.js" />
	<load href="__PUBLIC__/bootstrap/js/bootstrap.min.js" />  
    <script type="text/javascript" src="__PUBLIC__/index/js/jquery.form.js" ></script>
	<style type="text/css"> 
	</style>
</head>
<body>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" ></script> 
<nav class="navbar navbar-default">
	<div class="container-fluid"> 
		<div class="navbar-header"><h2 style="text-align: center; margin:0px; padding:0px; line-height:40px; font-size:18px;">绑定客服</h2></div>
	</div>
</nav>   

 <div style="margin: 15px; text-align: center;">
 	<div id="spanBox">
		<div class="form-group">
			<label for="exampleInputEmail1">二维码</label>
			<input type="email" class="form-control" id="code" placeholder="Email">
		</div>
		<button type="button" class="btn btn-primary btn-block" onclick="scan()">验证用户</button>
	</div>
	<div style="height: 50px"></div>
 	<div id="bindBox"> 
		<button type="button" class="btn btn-primary btn-block" onclick="doBand()">绑定用户</button>
	</div>
 </div>
 
<script language="javascript">

var url = '/index.php/kefu/getjsConf';
$(function(){
	
	$.post(url,{url:location.href},function(obj){
		console.log(obj); 
		wx.config({
		    //debug: true,
		    appId: obj.d.appid,  
		    timestamp: obj.d.timestamp, 
		    nonceStr: obj.d.noncestr, 
		    signature: obj.d.signature, 
		    jsApiList: [ 'onMenuShareTimeline','onMenuShareAppMessage','scanQRCode' ]  
		}); 
	},'json');
});
function scan(){
	wx.scanQRCode({
	    needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
	    scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码，默认二者都有
	    success: function (res) {
		    $('#code').val(res.resultStr); // 当needResult 为 1 时，扫码返回的结果
		}
	});
}


function doBand(){
	var url = '';
	var parm = '';
	$.post(url,parm,function(obj){
		
	},'json');
}
</script>
</body>
</html>